#ifndef LOGINWIDGET_H
#define LOGINWIDGET_H

#include <QWidget>
#include <QLineEdit>
#include <QLabel>
#include <QPushButton>
#include <QVBoxLayout>
#include <QSpacerItem>
#include <QPainter>
#include <QPainterPath>
#include <QEvent>
#include <QMouseEvent>
#include <QPoint>


class LoginWidget : public QWidget
{
    Q_OBJECT
public:
    explicit LoginWidget(QWidget *parent = nullptr);

    void paintEvent(QPaintEvent* event) override;

    // 支持窗口拖动
    void mousePressEvent(QMouseEvent* event) override;
    void mouseMoveEvent(QMouseEvent* event) override;

    // 注册登录切换
    void switchMode();

    // 登录
    void clickSubmitBtn();

private:
    QPoint m_dragPosition;          // 主持窗口拖动的

    bool isLoginMode = true;        // 标识是登录还是注册

    QLineEdit* userNameEdit;        // 用户名
    QLineEdit* passwordEdit;        // 密码
    bool isvisible = false;
    QLineEdit* verifyCodeEdit;      // 验证码

    QLabel* titleLabel;             // 标题
    QPushButton* submitBtn;         // 登录
    QPushButton* phoneModeBtn;      // 手机号登录
    QPushButton* switchModeBtn;     // 注册登录切换
signals:
};

#endif // LOGINWIDGET_H
